package com.len.entity;

public class TestEntiy implements Comparable {

    private Integer id;
    private String name;
    private String desc;


    public TestEntiy(Integer id, String name, String desc) {
        this.id = id;
        this.name = name;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "TestEntiy{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public int compareTo(Object o) {
        if (!(o instanceof TestEntiy)){
            throw new RuntimeException("类型转换异常");
        }
        TestEntiy testEntiy = (TestEntiy) o;
        int num = this.id - testEntiy.id;
        return num;
    }
}
